package com.lzq.model.factory.abs;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author : modify
 * @version : v1.0
 * @description :
 * @createTime : 2022/11/15 14:30
 * @updateUser : modify
 * @updateTime : 2022/11/15 14:30
 * @updateRemark :
 */
public class Demo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
        //获取迭代器对象
        Iterator<String> it = list.iterator();
        //使用迭代器遍历
        while (it.hasNext()) {
            String ele = it.next();
            System.out.println(ele);
        }
    }
}